<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<!-- Casting SPELs in Lisp - Emacs Lisp Edition, a Comic Book
     Written by Conrad Barski, M.D., http://lisperati.com
     Edited by James A. Webb, http://uberkode.com -->

<head>

  <title>Casting SPELs in Lisp (33)</title>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="author" content="James A. Webb" />
  <meta name="date" content="2007-09-16T00:00:00+00:00" />
  <meta name="keywords" content="Emacs, Lisp" />

</head>

<body>

<center>

<table cellspacing="10" width="500">
  <tr>
    <td bgcolor="#AAFFAA" width="500" height="50" align="center">
        <b>The Case Against the word "Macro"</b>
    </td>
  </tr>
  <tr>
    <td>
      Part of the purpose of writing this tutorial is to experiment
      with ways that can tackle the difficult subject of "true
      macros" in Lisp. Often, when I try to explain the concept of
      macros to somebody who has only used other languages, I'll get
      a response like "Oh yeah! There's macros like that in C++,
      too!" The moment this happens, it becomes very difficult to
      explain true macros, because of the semantic load on the word
      "macro". After all, true macros really are a lot like C++
      macros, in that they are a way to talk to the compiler with
      modified code...
    </td>
  </tr>
  <tr>
    <td>
      ...so imagine if
      <a href="http://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)" >John McCarthy</a>
      (the inventor of Lisp) had used the word "add" instead of "cons"
      to connect items to lists: It would make it really difficult
      to explain how consing works.
    </td>
  </tr>
  <tr>
    <td>
      Therefore, I decided to experiment with a new term for a macro
      in this essay: <b>SPEL</b>, which stands for "<b>S</b>emantic
      <b>P</b>rogram <b>E</b>nhancement <b>L</b>ogic", which is
      admittedly a bit of a stretch, but the term has many benefits:
    </td>
  </tr>
  <tr>
    <td>
      <ol>
	<li>It captures the almost magical power that Lisp macros
	  can have to change the behavior of a Lisp environment.</li>
	<li>The term SPEL can be used in a million different ways to
	  explain programming concepts in elegant ways, using the
	  metaphor of the <i>spell</i> and <i>casting spells</i>.</li>
	<li>The term causes no confusion between true macros and
	  other types of macros.</li>
	<li>The semantic load of the term <b>SPEL</b> is very low.
	  A <a href="http://google.com" >Google</a> search for
	  "(macro OR macros) programming -lisp -scheme" returns
	  about 1,150,000 hits. A Google search for
	  "(spel OR spels) programming -lisp -scheme" returns only
	  about 28,400. Even worse when you consider that the search
	  "(macro OR macros) programming (lisp OR scheme)" only
	  returns a measly 395,000! </li>
      </ol>
    </td>
  </tr>
  <tr>
    <td>
      So I hope, as a Lisper, you'll consider supporting this new
      term. Naturally, any new memes like this have a very low
      likelihood of success.
    </td>
  </tr>
  <tr>
    <td>
      If you have a library or are a Lisp implementation author,
      <b>please drop everything you are doing right now</b>
      and add the following line to your library:
    </td>
  </tr>
  <tr>
    <td>
<pre style="font-weight: bolder; color: darkblue">
  (defmacro defspel (&amp;rest rest) `(defmacro ,@rest))
</pre>
    </td>
  </tr>
  <tr>
    <td>
      There, problem solved!
    </td>
  </tr>
  <tr>
    <td>
      <b>;-)</b>
    </td>
  </tr>
  <tr>
    <td>
      -- Conrad Barski, M.D.
    </td>
  </tr>
  <tr>
    <td align="center">
      &lt;&lt; <a href="casting-spels-emacs-1.html">begin</a>
      &lt; <a href="casting-spels-emacs-32.html">previous</a> - 
      <a href="casting-spels-emacs-34.html">next</a> &gt;
      <a href="casting-spels-emacs-35.html" >end</a> &gt;&gt;
    </td>
  </tr>
</table>

</center>

</body>

</html>